package com.luyi.sensor.entity;


import cn.hutool.core.date.DateTime;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.sql.Date;
import java.time.LocalDateTime;

/**
 * Sensor传感器的CK实体类
 * author: luyi
 * time: 2022/1/3 13:00
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class SensorRecord implements Serializable {

    @JsonIgnoreProperties({"record_id"})//序列化允许忽略
    private long record_id;//主键ID
    //    @Null
    private long sensor_id;

    //    @NotNull(message = "单片值名为null，请传值")
    //    @NotEmpty(message = "单片值不能为空，请传值")

    //    @Null
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
//    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
//    @JsonSerialize(using = LocalDateTimeSerializer.class)
    private DateTime create_time;
//    private LocalDateTime create_time;//
    private float sensor_value;//第一参数


}
